/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lesson3.com.demo.ser;

import java.io.*;


public class SerializeDog {
    
    public static void main(String[] args) throws IOException{
        Dog myDog = new Dog();
        myDog.setAge(6);
        myDog.setName("Daisy");
        myDog.setWeight(65);
        
        File f = new File("daisy.ser");
        FileOutputStream fos = new FileOutputStream(f);
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        
        oos.writeObject(myDog);
        
        oos.flush();
        oos.close();
        System.out.println("Just serialized a dog :" +myDog);
    }

}
